package com.cskaoyan.dbutils.handlerDemo;

import com.cskaoyan.connectionpool.DruidUtils;
import com.cskaoyan.dbutils.bean.Account;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

/**
 * 创建日期: 2022/04/23 11:45
 *
 * @author ciggar
 */
public class BeanListHandlerDemo {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());


        List<Account> accountList = queryRunner.query("select * from account where id > ?",new BeanListHandler<>(Account.class),5);


        System.out.println(accountList);
    }
}
